import request from '@/api/myRequest'

function findOrdersByPage(start, limit, data) {
  return request({
    url: `/lejuAdmin/order/findOrdersByPage/${start}/${limit}`,
    method: 'post',
    data
  })
}

// 查看订单明细
function orderDetail(id) {
  return request({
    url: `/lejuAdmin/order/orderDetail/${id}`,
    method: 'get'
  })
}
// 确认收货
function sendDone(data) {
  return request({
    url: '/lejuAdmin/order/sendDone',
    method: 'post',
    data
  })
}
// 关闭订单
function finishOrder(id) {
  return request({
    url: `/lejuAdmin/order/finishOrder/${id}`,
    method: 'post'
  })
}
// 强制确认收货
function receiveProductsForce(id) {
  return request({
    url: `/lejuAdmin/order/receiveProductsForce/${id}`,
    method: 'post'
  })
}
// 退单列表
function findReturnApply(start, limit, data) {
  return request({
    url: `/lejuAdmin/orderReturn/findReturnApply/${start}/${limit}`,
    method: 'post',
    data
  })
}
// 退单明细
function orderReturn(id) {
  return request({
    url: `/lejuAdmin/orderReturn/${id}`,
    method: 'get'
  })
}
// 收到退货
function receiveProduct(id, data) {
  return request({
    url: `/lejuAdmin/orderReturn/receiveProduct/${id}`,
    method: 'post',
    data
  })
}
// 同意退货
function agreeApply(id, data) {
  return request({
    url: `/lejuAdmin/orderReturn/agreeApply/${id}`,
    method: 'post',
    data
  })
}
// 拒绝退货
function rejectApply(id, data) {
  return request({
    url: `/lejuAdmin/orderReturn/rejectApply/${id}`,
    method: 'post',
    data
  })
}
export { findOrdersByPage, orderDetail, sendDone, finishOrder, findReturnApply, orderReturn, receiveProduct, agreeApply, rejectApply, receiveProductsForce }
